package xyz.pro5books.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import xyz.pro5books.mapper.UserOperMapper;
import xyz.pro5books.pojo.UserOper;

import java.util.Date;
@Service
public class UserOperServiceImpl implements UserOperService{
    @Autowired
    private UserOperMapper userOperMapper;

    @Override
    public void writeDownloadOperInfo(Integer userId, Integer bookId) {
        UserOper userOper = new UserOper();
        userOper.setUserId(userId)
                .setBookId(bookId)
                .setTime(new Date())
                .setOperation(2);
        userOperMapper.insert(userOper);
    }
}
